/**
 * http://usejsdoc.org/
 */

var mqtt = require('mqtt');

var client = mqtt.createClient(8080, 'localhost', {clientId:'linyanwen', username:'shansjlin', password: 'e608b4cefeeb9ffeb80f064bcb120ae12d877e4fd0c7e771129e2c049d26da77', clean:false});

var num = 0;
setInterval(function () {
  for(var i = 0; i < 1; i++) {
	  client.publish('shansjlin', 'Hello mqtt ' + (num++),{qos:1, retain: true});
	  console.log("publish topic shansjlin, num: ", num);
  }
}, 1000);
